package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IncomeLogMapper;
import com.ruoyi.system.domain.IncomeLog;
import com.ruoyi.system.service.IIncomeLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户收入Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-12
 */
@Service
public class IncomeLogServiceImpl implements IIncomeLogService 
{
    @Autowired
    private IncomeLogMapper incomeLogMapper;

    /**
     * 查询用户收入
     * 
     * @param id 用户收入主键
     * @return 用户收入
     */
    @Override
    public IncomeLog selectIncomeLogById(String id)
    {
        return incomeLogMapper.selectIncomeLogById(id);
    }

    /**
     * 查询用户收入列表
     * 
     * @param incomeLog 用户收入
     * @return 用户收入
     */
    @Override
    public List<IncomeLog> selectIncomeLogList(IncomeLog incomeLog)
    {
        return incomeLogMapper.selectIncomeLogList(incomeLog);
    }

    /**
     * 新增用户收入
     * 
     * @param incomeLog 用户收入
     * @return 结果
     */
    @Override
    public int insertIncomeLog(IncomeLog incomeLog)
    {
        incomeLog.setCreateTime(DateUtils.getNowDate());
        return incomeLogMapper.insertIncomeLog(incomeLog);
    }

    /**
     * 修改用户收入
     * 
     * @param incomeLog 用户收入
     * @return 结果
     */
    @Override
    public int updateIncomeLog(IncomeLog incomeLog)
    {
        incomeLog.setUpdateTime(DateUtils.getNowDate());
        return incomeLogMapper.updateIncomeLog(incomeLog);
    }

    /**
     * 批量删除用户收入
     * 
     * @param ids 需要删除的用户收入主键
     * @return 结果
     */
    @Override
    public int deleteIncomeLogByIds(String ids)
    {
        return incomeLogMapper.deleteIncomeLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户收入信息
     * 
     * @param id 用户收入主键
     * @return 结果
     */
    @Override
    public int deleteIncomeLogById(String id)
    {
        return incomeLogMapper.deleteIncomeLogById(id);
    }
}
